package com.xdz.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.xdz.annotation.ShowStatus;
import com.xdz.valid.AddGroup;
import com.xdz.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author xdz
 * @email 1351959729@qq.com
 * @date 2020-12-08 20:30:45
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@NotNull(message = "品牌id不能为空",groups = {UpdateGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotEmpty(message = "品牌名不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(message = "品牌logo不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@ShowStatus(value = {0,1},message = "显示状态只能是0或1",groups = {AddGroup.class,UpdateGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@Pattern(regexp = "^[a-zA-Z]+$",message = "首字母只能是a-z字母",groups = {AddGroup.class,UpdateGroup.class})
	@NotEmpty(message = "检索字母不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@Min(value = 0,groups = {AddGroup.class,UpdateGroup.class})
	private Integer sort;

}
